﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/displaytag-el.tld" prefix="display" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/sharedfilecategory.tld" prefix="sfcat"%>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<%request.setAttribute("curDate",new java.util.Date());%>
<html:link page="/sf.mrqa?action=list">MFer 资料</html:link><sfcat:insert resultKind="navilinks"/>
<div style="background-color:#F4F8FC;"><sfcat:insert resultKind="top"/></div>
<table>
    <tr><td height="2"></td></tr>
</table>
<div style="width:100%;">
    <c:if test="${param.catId == null}">
        <span class="title" id="list">
            <html:link page="/sf.mrqa?action=list" styleClass="tab">
                最新资料
            </html:link>
        </span>
        <span class="title" id="recommendedlist">
            <html:link page="/sf.mrqa?action=recommendedlist" styleClass="tab">
                推荐资料
            </html:link>
        </span>
    </c:if>    
    <c:if test="${param.catId != null}">
        <c:set var="catId" value="${param.catId}"/>
        <span class="title" id="list">
            <html:link page="/sf.mrqa?action=list" styleClass="tab" paramName="catId" paramId="catId">
                最新资料
            </html:link>
        </span>
        <span class="title" id="recommendedlist">
            <html:link page="/sf.mrqa?action=recommendedlist" styleClass="tab" paramName="catId" paramId="catId">
                推荐资料
            </html:link>
        </span>
    </c:if>    
</div>
<display:table name="sfs" class="qlist" id="sf" cellspacing="0" cellpadding="0">
        <display:column title="分类">
            <c:set var="sfc_id" value="${sf.mrIaskSharedFileCategory.id}"/>
            <html:link page="/sf.mrqa?action=list" paramId="catId" paramName="sfc_id">
                        [<c:out value="${sf.mrIaskSharedFileCategory.name}"/>]
            </html:link>
        </display:column>
    <display:column title="资料名称">
        <html:link page="/sf.mrqa?action=view" paramId="id" paramProperty="id" paramName="sf" title="点击下载">
            <c:out value="${sf.name}"/>
        </html:link>
            <c:set var="differ" value="${(curDate.time-sf.postDate.time)/3600000}"/>
            <c:if test="${differ <= 48}">
                <font color="#FF0000" title="48小时内新帖子">(new)</font>
            </c:if>
    </display:column>
    <display:column title="访问/下载" style="width:60;">
            <c:out value="${sf.viewCount}"/>/<c:out value="${sf.downloadCount}"/>
    </display:column>
    <display:column property="postDate" title="上传时间" format="{0,date,yyyy-MM-dd}" style="width:70;"/>
    <display:column title="上传者" style="width:70;">
        <c:set var="user_id" value="${sf.mrIaskUser.id}"/>
        <c:set var="user_loginname" value="${sf.mrIaskUser.loginName}"/>
        <html:link page="/user.mrqa?action=viewuserbyother" styleId="author" paramId="id" paramName="user_id">
                    <c:out value="${user_loginname}"/>
        </html:link>
    </display:column>
</display:table>
<br>
<qautil:page action="/sf.mrqa"/>
<script type="text/javascript">
    var selectedView = '<c:out value="${param.action}"/>';
    function initView()
    {
        if('' != selectedView)
        {
            var selectedViewSpan = document.getElementById(selectedView);
            if(selectedViewSpan == null)return;
            selectedViewSpan.className = "title1";
        }
    }
    initView();
</script>
<c:if test="${filesSize < filesSizePerPage and fn:contains(param.action,'list')}">
<br>
<br>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-3370373040606812";
/* MR_Iask_List 468x60, by William 08-8-30 */
google_ad_slot = "8374166115";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</c:if>